<?php

Yii::import('admin.models._base.BaseNews');

class News extends BaseNews
{
	public static function model($className=__CLASS__) {
		return parent::model($className);
	}
	public function behaviors()
	{
		return array(
			'ml' => array(
				'class' => 'application.modules.admin.models.behaviors.MultilingualBehavior',
				'localizedAttributes' => array('title','body','small'),
				'langClassName' => 'NewsLang',
				'langTableName' => 'news_lang',
				'languages' => Yii::app()->params['translatedLanguages'],
				'defaultLanguage' => Yii::app()->params['defaultLanguage'],
				'langForeignKey' => 'owner_id',
				'dynamicLangClass' => true,
			),
		);
	}

	public function defaultScope()
	{
		return $this->ml->localizedCriteria();
	}
}